Delete an attribute and its type

How to delete an attribute and its type using dxl?

 

Thank you in advance.


cron7 - Thu Oct 26 04:57:46 EDT 2017

Re: Delete an attribute and its type
O.Wilkop - Thu Oct 26 05:20:48 EDT 2017

Module m = current;
string szAttribute = "Attribute To Find";

AttrDef ad = find(m, szAttribute);
if(!null ad){
        AttrType at = ad.type;
        string szErrorAd = delete(m, ad);
        if(!null szErrorAd){
                print "Error deleteing AttributeDefinition: "szErrorAd"\n";
        }else{
                string szErrorAt = "";
                if(!delete(at, szErrorAt)){
                        print "Error deleting AttributeType: "szErrorAt"\n";
                }
        }
}

I didn't test the code but something like this should do the job